#ifndef __PID_H
#define __PID_H	

typedef struct {
    float Targetangle;    
    float Realangle;    
    float error;       
    float error_last;     
    float kp, ki, kd;   
    float integral;     
    float integralLimit; 
    float output;        
    float outputLimit;   
} PID_Controller;

void PID_Init(PID_Controller *pid);
float PID_Update(PID_Controller *pid,float angle,float realangle);

//extern PID_Controller motor_pid;

#endif

